package com.fg.cloud.common.construction;

import java.math.BigDecimal;

/**
 * 标准Select数据封装器
 * @author around
 * @date 2017-7-21
 */
public class Select implements java.io.Serializable {

	private static final long serialVersionUID = 8960849759558094211L;

	/** id */
	private Long id;
	
	/** 绑定显示文本 */
	private String label;
	
	private String value;
	
	private BigDecimal discount;
	
	private Boolean isActive = false;

	public Select() {}

	public Select(String label) {
		super();
		this.label = label;
	}
	
	public Select(String label, String value) {
		super();
		this.label = label;
		this.value = value;
	}
	
	public Select(String label, String value, Boolean isActive) {
		super();
		this.label = label;
		this.value = value;
		this.isActive = isActive;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
		this.value = id == null ? null : String.valueOf(id);
	}

	public Boolean getIsActive() {
		return isActive;
	}

	public void setIsActive(Boolean isActive) {
		this.isActive = isActive;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getValue() {
		return value;
	}

	public BigDecimal getDiscount() {
		return discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	@Override
	public String toString() {
		return "Select [id=" + id + ", label=" + label + "]";
	}
	
	@Override
	public boolean equals(Object obj) {
		return this.getLabel().equals(((Select)obj).getLabel());
	}
	
}
